4.6.áFolder sharing

Shared folders allow you to access files of your host system from within the guest system, much like ordinary shares on Windows networks would -- except that shared folders do not need a networking setup. Shared folders must physically reside on the host and are then shared with the guest; sharing is accomplished using a special service on the host and a file system driver for the guest, both of which are provided by VirtualBox.

In order to use this feature, the VirtualBox Guest Additions have to be installed. Note however that Shared Folders are only supported with Windows (2000 or newer) guests and Linux guests.

To share a host folder with a virtual machine in VirtualBox, you must specify the path of that folder and choose for it a "share name" that the guest can use to access it. Hence, first create the shared folder on the host; then, within the guest, connect to it.

There are several ways in which shared folders can be set up for a particular virtual machine:

There are two types of shares:

  1. VM shares which are only available to the VM for which they have been defined;

  2. transient VM shares, which can be added and removed at runtime and do not persist after a VM has stopped; for these, add the -transient option to the above command line.

Shared folders have read/write access to the files at the host path by default. To restrict the guest to have read-only access, create a read-only shared folder. This can either be achieved using the GUI or by appending the parameter -readonly when creating the shared folder with VBoxManage.

Then, you can mount the shared folder from inside a VM the same way as you would mount an ordinary network share: